package com.dhecp.core.genericDao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * DynamicSqlParameter
 */
public class DynamicSqlParameter {
    private int pageNo;
    private int pageSize;
    private Map<String, Object> inParams;
    private List<Sort> sorts;

    public DynamicSqlParameter() {
        inParams = new HashMap<String, Object>();
        sorts = new ArrayList<Sort>();
        pageNo = 1;
        pageSize = 20;
    }

    public Map<String, Object> getInParams() {
        return inParams;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getOffset() {
        return ((pageNo > 0 ? pageNo : 1) - 1) * pageSize;
    }

    public int getStartNo() {
        return ((pageNo > 0 ? pageNo : 1) - 1) * pageSize + 1;
    }

    public int getEndNo() {
        return (pageNo > 0 ? pageNo : 1) * pageSize;
    }

    public List<Sort> getSorts() {
        return sorts;
    }
}
